using System;
using System.Data;
using System.Configuration;

/// <summary>
/// Static SQL string container for all queries used by AjaxNinja Facebook Applications
/// </summary>
namespace AjaxNinja.Data
{
    public static class SQLStrings
    {
        public static readonly string SQLaddNewUser = @"INSERT INTO
        Users (UserID) VALUES (@UserID)";
        public static readonly string SQLaddMadMsg = @"INSERT INTO
        WhatMadeMeMad (UserID, MadText, MadTime) VALUES (@UserID, @MadText, @MadTime)";
        public static readonly string SQLgetRandomStartMsg = @"SELECT TOP 1 RandomMadText 
        FROM SampleMadText ORDER BY NEWID()";
        public static readonly string SQLgetLastMsg = @"SELECT TOP (1) WhatMadeMeMad.StoryID, WhatMadeMeMad.MadText, WhatMadeMeMad.MadTime AS EntryTime
        FROM         Users INNER JOIN
                      WhatMadeMeMad ON Users.UserID = WhatMadeMeMad.UserID
        WHERE     (Users.UserID = @UserID)
        ORDER BY WhatMadeMeMad.MadTime DESC";
        public static readonly string SQLgetMsgHistory = @"
        SELECT TOP (20) WhatMadeMeMad.StoryID, WhatMadeMeMad.MadText, WhatMadeMeMad.MadTime AS EntryTime
        FROM         Users INNER JOIN
                      WhatMadeMeMad ON Users.UserID = WhatMadeMeMad.UserID
        WHERE     (Users.UserID = @UserID)
        ORDER BY WhatMadeMeMad.MadTime DESC";
        public static readonly string SQLcheckUserExists = @"SELECT TOP (1) UserID
        FROM Users WHERE UserID = @UserID";

        public static readonly string SQLgetSpecificItem = @"SELECT TOP (1) WhatMadeMeMad.StoryID,
        WhatMadeMeMad.MadText, WhatMadeMeMad.MadTime AS EntryTime FROM Users INNER JOIN WhatMadeMeMad ON Users.UserID = WhatMadeMeMad.UserID
        WHERE (Users.UserID = @UserID) AND (WhatMadeMeMad.StoryID = @StoryID)";
    }
}
